<template>
  <div>
    {{ count }}
  </div>
</template>
<script>
import { state, mutations } from '@/assets/scripts/observable';
export default {
  computed: {
    count() {
      return state.count;
    },
  },
  methods: {
    foo() {
      console.log('im foo from comp2');
    },
  },
  mounted() {
    mutations.setFun(this.foo);
  },
};
</script>

